package cn.edu.wfit.modules.learn.service.impl.competitionmanagement;

import java.util.List;
import cn.edu.wfit.common.core.utils.DateUtils;
import cn.edu.wfit.modules.learn.domain.WfitCompetition;
import cn.edu.wfit.modules.learn.mapper.competitionmanagement.WfitCompetitionMapper;
import cn.edu.wfit.modules.learn.service.competitionmanagement.IWfitCompetitionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * 竞赛Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-28
 */
@Service
public class WfitCompetitionServiceImpl implements IWfitCompetitionService
{
    @Autowired
    private WfitCompetitionMapper wfitCompetitionMapper;

    /**
     * 查询竞赛
     * 
     * @param id 竞赛主键
     * @return 竞赛
     */
    @Override
    public WfitCompetition selectWfitCompetitionById(Long id)
    {
        return wfitCompetitionMapper.selectWfitCompetitionById(id);
    }

    /**
     * 查询竞赛列表
     * 
     * @param wfitCompetition 竞赛
     * @return 竞赛
     */
    @Override
    public List<WfitCompetition> selectWfitCompetitionList(WfitCompetition wfitCompetition)
    {
        return wfitCompetitionMapper.selectWfitCompetitionList(wfitCompetition);
    }

    /**
     * 新增竞赛
     * 
     * @param wfitCompetition 竞赛
     * @return 结果
     */
    @Override
    public int insertWfitCompetition(WfitCompetition wfitCompetition)
    {
        wfitCompetition.setCreateTime(DateUtils.getNowDate());
        return wfitCompetitionMapper.insertWfitCompetition(wfitCompetition);
    }

    /**
     * 修改竞赛
     * 
     * @param wfitCompetition 竞赛
     * @return 结果
     */
    @Override
    public int updateWfitCompetition(WfitCompetition wfitCompetition)
    {
        wfitCompetition.setUpdateTime(DateUtils.getNowDate());
        return wfitCompetitionMapper.updateWfitCompetition(wfitCompetition);
    }

    /**
     * 批量删除竞赛
     * 
     * @param ids 需要删除的竞赛主键
     * @return 结果
     */
    @Override
    public int deleteWfitCompetitionByIds(Long[] ids)
    {
        return wfitCompetitionMapper.deleteWfitCompetitionByIds(ids);
    }

    /**
     * 删除竞赛信息
     * 
     * @param id 竞赛主键
     * @return 结果
     */
    @Override
    public int deleteWfitCompetitionById(Long id)
    {
        return wfitCompetitionMapper.deleteWfitCompetitionById(id);
    }
}
